﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SimpComm
{
    public class PagedModel
    {

        public PagedModel()
        {
            //默认值 每页显示15条记录 从第1页开始
            this.PageSize = 3;
            this.CurrentPageIndex = 1;
        }

        /// <summary>
        /// 当前页的索引
        /// </summary>
        public int CurrentPageIndex { get; set; }
        /// <summary>
        /// 每页显示的记录条数
        /// </summary>
        public int PageSize { get; set; }

        /// <summary>
        /// 总记录条数
        /// </summary>
        public int TotalRecordCount { get; set; }

        /// <summary>
        /// 当前字典值
        /// </summary>
        public Dictionary<string, object> MyRoutes { get; set; }

        /// <summary>
        /// 分页总数
        /// </summary>
        public int PageCount
        {
            get
            {
                if (TotalRecordCount % PageSize == 0)
                {
                    return TotalRecordCount / PageSize;
                }
                else
                {
                    return TotalRecordCount / PageSize + 1;
                }
            }
        }
    }

    public class SelectBoxView
    {
        public SelectBoxView() { }
        public SelectBoxView(string value, string text)
        {
            Value = value;
            Text = text;
        }
        public SelectBoxView(byte value, string text)
        {
            Value = value.ToString();
            Text = text;
        }
        public string Value { get; set; }
        public string Text { get; set; }
    }
    public class SelectBoxModel
    {
        public string ControlID { get; set; }
        public List<SelectBoxView> DataBind { get; set; }
        public SelectBoxView DefaultValue { get; set; }
        public bool IsInputBox { get; set; }
    }
}
